import React from "react";
import { Popover, Image } from "antd";
import { text_check, box_type_list } from "../../utils";

export default function TypeIconTemp(props) {
  const { avm_msg } = props;
  function toolModule(text) {
    return avm_msg[text] ? (
      <span className="icon_style">
        <Popover
          placement="bottomLeft"
          content={<div>{text_check(box_type_list[text])}</div>}
        >
          <Image
            src={`images/${text}.svg`}
            fit="contain"
            style={{
              height: "20px",
              width: "20px",
            }}
            preview={false}
            alt={text_check(box_type_list[text])}
          />
        </Popover>
      </span>
    ) : (
      ""
    );
  }
  return (
    <>
      {toolModule("beverage_nu")}
      {toolModule("spiral_nu")}
      {toolModule("locker_nu")}
      {toolModule("basket_nu")}
      {toolModule("soap_nu")}
      {toolModule("elevator_nu")}
    </>
  );
}
